library extension_api;
import 'lib/some_api.dart';

extension a on Group {
  void removeYoungest() {
    var sorted = people.toList()
      ..sort((a, b) => a.dayOfBirth.compareTo(b.dayOfBirth));
    var youngest = sorted.last;
    print('youngest: ${youngest.name}');
    people.remove(youngest);
  }

  void show() => print(this);
}

extension ab on Group {
  void removeYoungest() {
    var sorted = people.toList()
      ..sort((a, b) => a.dayOfBirth.compareTo(b.dayOfBirth));
    var youngest = sorted.last;
    print('youngest: ${youngest.name}');
    people.remove(youngest);
  }

  void show() => print(this);
}
